From: Florian Müllner Date: Thu, 15 Nov 2018 14:38:11 +0000 (+0100) Subject: keyboard: Use addSettingsItem() in language menu X-Git-Tag: archive/raspbian/50.5-1+rpi1~1^2~897^2^2~161 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=f8ce47c24dd5babe94785822ebec4f6d55c70984;p=gnome-shell.git keyboard: Use addSettingsItem() in language menu If the session mode doesn't allow access to Settings, the language menu should respect that and not expose the "Region & Languages" panel. Using the dedicated method instead of manually constructing the menu item takes care of that and makes for less code. https://gitlab.gnome.org/GNOME/gnome-shell/issues/780 --- diff --git a/js/ui/keyboard.js b/js/ui/keyboard.js index 106c30210..fac42671d 100644 --- a/js/ui/keyboard.js +++ b/js/ui/keyboard.js @@ -195,7 +195,7 @@ var LanguageSelectionPopup = new Lang.Class({ } this.addMenuItem(new PopupMenu.PopupSeparatorMenuItem()); - this.addAction(_("Region & Language Settings"), this._launchSettings.bind(this)); + this.addSettingsAction(_("Region & Language Settings"), 'gnome-region-panel.desktop'); this._capturedEventId = 0; this._unmapId = actor.connect('notify::mapped', () => { @@ -204,11 +204,6 @@ var LanguageSelectionPopup = new Lang.Class({ }); }, - _launchSettings() { - Util.spawn(['gnome-control-center', 'region']); - this.close(true); - }, - _onCapturedEvent(actor, event) { if (event.get_source() == this.actor || this.actor.contains(event.get_source()))